import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./vuex/index";
import artists from "./components/artists.vue";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import MuseUI from "muse-ui";
import "muse-ui/dist/muse-ui.css";
import VueLazyload from "vue-lazyload";
import "./assets/fonts/extra-icon/iconfont.css";
import api from "./api/index";
import Component from "vue-class-component";
import VideoPlayer from "vue-video-player";
import "video.js/dist/video-js.css";
import "vue-video-player/src/custom-theme.css";
import { dateFilter } from "./utils/date-pipe";

//#region 引入组件
Vue.use(MuseUI);
Vue.use(VideoPlayer);
Vue.use(VueLazyload, {
  error: require("./assets/imgs/404.png"),
  loading: require("./assets/imgs/loading.jpg"),
  attempt: 1,
});
Vue.use(ElementUI);
Vue.filter("date", dateFilter);
//#endregion

//#region 注册路由生命 周期
Component.registerHooks([
  "beforeRouteEnter",
  "beforeRouteLeave",
  "beforeRouteUpdate",
]);
//#endregion

// 保存变量到Vue原型上
Vue.prototype.$api = api;
// 不知道是干嘛的
Vue.config.productionTip = false;

// 歌手页面组件
Vue.component("artists", artists);

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
